<template>
  <div class="not-found-container">
    <div class="not-found-content">
      <div class="error-code">404</div>
      <div class="error-message">页面不存在或已被移除</div>
      <el-divider />
      <div class="error-desc">抱歉，您访问的页面不存在，请检查URL或返回首页</div>
      <div class="action-buttons">
        <el-button
            type="primary"
            size="large"
            @click="goHome"
            round
        >
          <el-icon><HomeFilled /></el-icon>
          返回首页
        </el-button>
        <el-button
            type="info"
            size="large"
            @click="goBack"
            round
        >
          <el-icon><ArrowLeft /></el-icon>
          返回上一页
        </el-button>
      </div>
    </div>
    <div class="error-image">
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { HomeFilled, ArrowLeft } from '@element-plus/icons-vue'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.not-found-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f0ff 100%);
  padding: 20px;
}

.not-found-content {
  max-width: 500px;
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 120, 255, 0.1);
}

.error-code {
  font-size: 120px;
  font-weight: bold;
  color: #1890ff;
  line-height: 1;
  margin-bottom: 20px;
}

.error-message {
  font-size: 24px;
  color: #333;
  margin-bottom: 20px;
}

.error-desc {
  color: #666;
  margin-bottom: 30px;
  font-size: 16px;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.error-image {
  margin-left: 60px;
}

.error-image img {
  max-width: 400px;
  height: auto;
}

.el-divider {
  margin: 20px 0;
  background-color: rgba(24, 144, 255, 0.2);
}

@media (max-width: 768px) {
  .not-found-container {
    flex-direction: column;
  }

  .error-image {
    margin-left: 0;
    margin-top: 40px;
  }

  .error-image img {
    max-width: 300px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 15px;
  }
}
</style>
